import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/views/Login'
import Index from '@/views/Index'
import User from '@/views/user/User'
import CategoryFirst from '@/views/category/categoryFirst'
import CategorySecond from '@/views/category/CategorySecond'
import ProductList from '@/views/productList/ProductList'

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    redirect: {
      name: 'Login'
    }
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/',
    name: 'Index',
    component: Index,
    children: [
      {
        path: 'user',
        name: 'User',
        component: User
      },
      {
        path: 'categoryFirst',
        name: 'CategoryFirst',
        component: CategoryFirst
      },
      {
        path: 'categorySecond',
        name: 'CategorySecond',
        component: CategorySecond
      },
      {
        path: 'productList',
        name: 'ProductList',
        component: ProductList
      }
    ]
  }
  ]
})
